package cn.tedu._03vehicle.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;

@Data
public class UserRegParam {
    //@NotNull(message = "用户名不能为空")
    //@NotEmpty(message = "用户名不能为空或空字符串")
    @NotBlank(message = "用户名不能为空或空字符串或空白")
    //@ApiModelProperty(value = "用户名", required = true, example = "admin")
    @Pattern(regexp = "^(?:(?:[\\u4e00-\\u9fa5]{1,8})|(?:[a-zA-Z]{1,14})|(?=[\\u4e00-\\u9fa5a-zA-Z]{7,14}$)(?:[\\u4e00-\\u9fa5]+[a-zA-Z]+|[a-zA-Z]+[\\u4e00-\\u9fa5]+)+)$", message = "必须是8个中文以内，或14个英文以内，或7-14个中英混合字符")
    private String username;

    @Pattern(regexp = "^[a-zA-Z0-9]{6,10}$",message = "密码必须是6到10位之间")
    @ApiModelProperty(value = "密码", required = true)
    private String password;

    @Email(message = "邮箱格式不正确")
    @ApiModelProperty(value = "邮箱", required = true)
    private String email;

    @ApiModelProperty(value = "手机号", required = true)
    private String phone;
}
